-
Notifications
You must be signed in to change notification settings - Fork 6
Spring 2025 Improvements #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 25 out of 61. Check the log or trigger a new build to see more.
|
|
||
| #include "utils/angle.hpp" | ||
| #include "utils/debug.hpp" | ||
| #include "utils/flags.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: included header debug.hpp is not used directly [misc-include-cleaner]
| #include "utils/flags.hpp" | |
| #include "utils/flags.hpp" |
|
|
||
| class BoomerangController : public AbstractController { | ||
| public: | ||
| enum class ThruBehavior { // affects calculation of lin_speed on thru movements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: enum 'ThruBehavior' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]
enum class ThruBehavior { // affects calculation of lin_speed on thru movements
^| MIN_VEL, // use linear PID, but enforce a minimum velocity | ||
| FULL_SPEED // no PID, go full speed | ||
| }; | ||
| enum class CosineScaling { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: enum 'CosineScaling' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]
enum class CosineScaling {
^| MIN_ERR, // only do cosine scaling within the minimum err | ||
| ALL_THE_TIME // do cosine scaling all the time | ||
| }; | ||
| enum class MinErrBehavior { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: enum 'MinErrBehavior' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]
enum class MinErrBehavior {
^|
|
||
| double min_vel; | ||
|
|
||
| ThruBehavior thru_behavior = ThruBehavior::FULL_SPEED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: member variable 'thru_behavior' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
ThruBehavior thru_behavior = ThruBehavior::FULL_SPEED;
^| target.theta}; | ||
| dx = carrotPoint.x - current_pos.x; | ||
| dy = carrotPoint.y - current_pos.y; | ||
| Point carrot_point; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: uninitialized record type: 'carrot_point' [cppcoreguidelines-pro-type-member-init]
| Point carrot_point; | |
| Point carrot_point{}; |
| target.theta}; | ||
| dx = carrotPoint.x - current_pos.x; | ||
| dy = carrotPoint.y - current_pos.y; | ||
| Point carrot_point; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'carrot_point' of type 'Point' can be declared 'const' [misc-const-correctness]
| Point carrot_point; | |
| Point const carrot_point; |
| dx = carrotPoint.x - current_pos.x; | ||
| dy = carrotPoint.y - current_pos.y; | ||
| Point carrot_point; | ||
| if (!reverse) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: if with identical then and else branches [bugprone-branch-clone]
if (!reverse) {
^Additional context
src/VOSS/controller/BoomerangController.cpp:36: else branch starts here
} else {
^| if (thru) { | ||
| lin_speed = copysign(fmax(fabs(lin_speed), this->min_vel), lin_speed); | ||
| if (thru_behavior == ThruBehavior::FULL_SPEED) { | ||
| lin_speed = 100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 100 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
lin_speed = 100;
^| double ang_speed; | ||
| if (distance_error < min_error) { | ||
| this->can_reverse = true; | ||
| double pose_error = voss::norm_delta(target_angle - current_angle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'pose_error' of type 'double' can be declared 'const' [misc-const-correctness]
| double pose_error = voss::norm_delta(target_angle - current_angle); | |
| double const pose_error = voss::norm_delta(target_angle - current_angle); |
No description provided.